 <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Settings</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="file:///sdcard/TVATA/logo_img.css" rel="stylesheet" type="text/css" />
<link href="file:///sdcard/TVATA/bgimg.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./js/config.js"></script>
<script type="text/javascript" src="./js/libs/VatataPublic.js"></script>
<script type="text/javascript" src="./js/libs/VatataKeyMove.js"></script>

</head>

<body>
<div class="container">
	<div class="header_erji">
    	<div class="title fl">
            <img src="images/arrowbotm.png">
            关于本机
        </div>
        <!--<div class="searchBox fl">
            <input class="fl" name="" type="text" value="请输入搜索信息，按摇控"OK"键确定搜索"OK"键入搜索"/>
            <div class="fl"><a href="#" class="searchIcon"></a></div>
        </div>
        <div class="fl"><a href="#" class="js"></a></div>-->
        <div class="now fr">
            <div class="week fl" id="weekId" style="display:none;"></div>
            <div class="date1 fl">
                <span id="timeId" style="display:none;"></span>
                <span class="time1" id="temperatureId" style="display:none;"></span>
            </div>
            <div class="degrees fl"></div>
            <img onerror="this.src='images/default.png'" style="display:none;" class="fl" id="temperatureImgId">
            <div class="clear"></div>
            
            <!-- <iframe src="" id="weather" frameborder="0" scrolling="no" class="iframe_inte "></iframe>
            <iframe src="" id="inte" frameborder="0" scrolling="no" class="iframe_weather"></iframe> -->
        </div>
        	
    </div>
    
    <div class="banben main_set">
    
    
    <div class="detail" >
        <div class="detail_left">
        <div class="logo2">天华雅歌OTT</div> 
        <div class="detail_name"></div>
        <div class="detail_num"></div>
        <!--  <div class="detail_sm">单击此处以查看法律声明</div>-->
        
        <div class="detail_copy"><span id="macId"></span> </br>www.tvata.com</br>Copyright  ©2013  TVA  Corp. </br> All Rights  Reserved.
       </div>
       
    </div>
    <div class="detail_right">
   		<marquee class="mar" direction="up" scrollamount=1 scrolldelay=0 id="verlistId"></marquee>
   		<a href="javascript:void(0)" id="checkverId" upid="checkverId" downid="checkverId"  leftid="checkverId" rightid="checkverId" onClick="checkver()">检查版本</a>
        
   		<div id="getflagId"></div>
    </div>
    
  <div class="banben_detail" style="display:none;" id="updataListId">
      <div class="banben_title">有新版本，请更新以获得更佳体验！</div>
      <marquee  class="marqur" direction="up" scrollamount=1 scrolldelay=0 id="updatalistId">
      </marquee>
      <a href="javascript:void(0)" id="closeId" upid="closeId" downid="closeId"  leftid="closeId" rightid="closeId" onClick="closeUpdataList()">关闭</a>
  </div>
</div>
        
         
       
    </div>
    <div class="numer" id="versionName"></div>
</div>

<script>

var simpleFile_obj = null;

function $(str) { return document.getElementById(str)}

window.onWAEReady = function(){
	
	

	VatataPublic.updatetime_Temperature($("weekId"),$("timeId"),$("temperatureId"),$("temperatureImgId"));
	
	VatataKeyMove.initVttKeymoveById($("checkverId"));
	
	try{
		if(simpleFile_obj==null){
			simpleFile_obj = wae.create("DATA.SimpleFile");
		}
	
		var verlist = simpleFile_obj.readFromRootPath('config.txt');
		var verlistobj  = eval(verlist);
		var listhtml =""
		for(i=0;i<verlistobj.length;i++){
			listhtml += verlistobj[i].name +"&nbsp;&nbsp;Ver:"+verlistobj[i].version+"&nbsp;&nbsp;"+verlistobj[i].date +"</br>";
		}
		
		$("verlistId").innerHTML = listhtml;
	
		showVersion();
		showMacId();
	}catch(e){}
	
}

var CallResulTimer = null;
function checkver(){
	try{
	
	var updataobj = wae.create("plugins.UpdateZip"); 
	
	
	updataobj.onCallAsync=function(e){
		var a = e.arguments[1];
		var b = e.arguments[0];
		if(b=="0"||b==0){
			$("getflagId").innerHTML  = "已经是最新版本";	
		}else{
			if(a!=""||a!=null){//有更新;
				try{
				$("checkverId").innerHTML  = "更新";
				$("updataListId").style.display = "block";
				
				var updatalistobj  = eval(a);
				var u_html =""
				for(i=0;i<updatalistobj.length;i++){
					u_html += updatalistobj[i].name +"&nbsp;&nbsp;Ver:"+updatalistobj[i].version+"&nbsp;&nbsp;"+updatalistobj[i].date +"</br>";
				}
				
				$("updatalistId").innerHTML = u_html;
				
				VatataKeyMove.initVttKeymoveById($("closeId"));
				$("checkverId").onclick = function(){
					
					updataobj.StartDownInstall();
					$("checkverId").style.display = "none";;
				}
				}catch(e){}
			}else{
				$("getflagId").innerHTML  = "已经是最新版本";	
			}		
		}
		
	   	
	}
	updataobj.MonitorUpdate();	
	}catch(e){}
	
	
}

//关闭更新列表
function closeUpdataList(){
	$("updataListId").style.display = "none";
	VatataKeyMove.initVttKeymoveById($("checkverId"));
	
}

/**
 * 显示版本号
 */

var application_obj = null;
//版本
function showVersion(){
	try{
	if(!application_obj){
		application_obj = wae.create("Application");
	}
	
	document.getElementById('versionName').innerText = 'ver '+application_obj.versionName() + '.' + HTML_PAGE_VERSION;
	}catch(e){}
}

var a_obj = null;
function showMacId(){
	try{
		if(!a_obj){
			a_obj = wae.create("Authority.LocalBoss")
		}
		
		var net_mac = a_obj.getLocalBossMacId();
		
		$("macId").innerHTML = '设备ID：'+net_mac;
	}catch(e){}
}



</script>

</body>
</html>
